//
//  ChannelApi.m
//  Api
//
//  Created by CPX on 2018/9/6.
//

#import "ChannelApi.h"

/**
 channel接口
 @author yzl
 */
@implementation ChannelApi

+ (void)getChannelListWithName:(NSString *)name offset:(NSInteger)offset success:(Success)success failure:(Failure)failure{
    NSString *url = [NSString stringWithFormat:@"%@%@",RootURL,VideoListPath];
    [NetworkManagerV3 GETWithURL:url header:[self header] params:@{@"ordering":name,@"offset":@(offset),@"limit":@(10)} success:^(id response) {
        if([self dealWithResponse:response]){
            success(response[@"data"]);
        }
        else{
            NSError *error = [NSError errorWithDomain:APPResponseError code:10001 userInfo:response];
            failure(error);
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end
